﻿using DoNet.Bpmn.Dtos;
using DoNet.Bpmn.IRepostitories;
using DoNet.Bpmn.IServices;
using DoNet.Bpmn.Models;
using DoNet.Core;

namespace DoNet.Bpmn.Services
{
    public class BpmnNodePersonnelEmplConfigService : BaseService<BpmnNodePersonnelEmplConfig, BpmnNodePersonnelEmplConfigOutputDto>, IBpmnNodePersonnelEmplConfigService
    {
        /// <summary>
        /// 
        /// </summary>
        private readonly IBpmnNodePersonnelEmplConfigRepository repository;
        /// <summary>
        /// 
        /// </summary>
        /// <param name="_baseRepository"></param>
        /// <param name="_repository"></param>
        public BpmnNodePersonnelEmplConfigService(IRepository<BpmnNodePersonnelEmplConfig> _baseRepository, IBpmnNodePersonnelEmplConfigRepository _repository)
        {
            baseRepository = _baseRepository;
            repository = _repository;
        }

        #region 同步方法
        /// <summary>
        /// 同步
        /// </summary>
        /// <param name="bpmnNodePersonneId"></param>
        /// <returns></returns>
        public BpmnNodePersonnelEmplConfig GetByBpmnNodePersonneId(long bpmnNodePersonneId)
        {
            return repository.GetByBpmnNodePersonneId(bpmnNodePersonneId);
        }
        /// <summary>
        /// 同步
        /// </summary>
        /// <param name="bpmnNodePersonneId"></param>
        /// <returns></returns>
        public IEnumerable<BpmnNodePersonnelEmplConfig> GetListByBpmnNodePersonneId(long bpmnNodePersonneId)
        {
            return repository.GetListByBpmnNodePersonneId(bpmnNodePersonneId);
        }
        #endregion 同步方法

        #region 异步方法
        /// <summary>
        /// 异步
        /// </summary>
        /// <param name="bpmnNodePersonneId"></param>
        /// <returns></returns>
        public async Task<BpmnNodePersonnelEmplConfig> GetByBpmnNodePersonneIdAsync(long bpmnNodePersonneId)
        {
            return await repository.GetByBpmnNodePersonneIdAsync(bpmnNodePersonneId);
        }
        /// <summary>
        /// 异步
        /// </summary>
        /// <param name="bpmnNodePersonneId"></param>
        /// <returns></returns>
        public async Task<IEnumerable<BpmnNodePersonnelEmplConfig>> GetListByBpmnNodePersonneIdAsync(long bpmnNodePersonneId)
        {
            return await repository.GetListByBpmnNodePersonneIdAsync(bpmnNodePersonneId);
        }
        #endregion 异步方法
    }
}
